.class public Lcom/htc/android/footprints/utils/StorageUtil;
.super Ljava/lang/Object;
.source "StorageUtil.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;
    }
.end annotation


# static fields
.field public static final ACTION_DEVICE_STORAGE_LOW:I = 0x7

.field public static final ACTION_DEVICE_STORAGE_OK:I = 0x8

.field public static final ACTION_MEDIA_MOUNTED:I = 0x1

.field public static final ACTION_MEDIA_SHARED:I = 0x6

.field public static final ACTION_MEDIA_UNMOUNTED:I = 0x2

.field private static final CANNOT_STAT_ERROR:I = -0x2

.field private static final NO_STORAGE_ERROR:I = -0x1

.field private static final PATH:Ljava/lang/String;

.field public static StorageCounter:I

.field private static TAG:Ljava/lang/String;

.field private static mInternalStorageFull:Z

.field private static mRemainingStroage:J


# instance fields
.field public isReg:Z

.field private mContext:Landroid/content/Context;

.field private mCurrentState:I

.field private mOnChangeStorageListener:Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;

.field private mReceiver:Landroid/content/BroadcastReceiver;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 19
    const-string v0, "StorageUtil"

    sput-object v0, Lcom/htc/android/footprints/utils/StorageUtil;->TAG:Ljava/lang/String;

    .line 21
    invoke-static {}, Landroid/os/Environment;->getDataDirectory()Ljava/io/File;

    move-result-object v0

    invoke-virtual {v0}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/htc/android/footprints/utils/StorageUtil;->PATH:Ljava/lang/String;

    .line 23
    sput v1, Lcom/htc/android/footprints/utils/StorageUtil;->StorageCounter:I

    .line 54
    sput-boolean v1, Lcom/htc/android/footprints/utils/StorageUtil;->mInternalStorageFull:Z

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 2
    .parameter "mCtx"

    .prologue
    const/4 v1, 0x0

    .line 56
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 46
    iput-boolean v1, p0, Lcom/htc/android/footprints/utils/StorageUtil;->isReg:Z

    .line 48
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mOnChangeStorageListener:Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;

    .line 50
    iput v1, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mCurrentState:I

    .line 57
    iput-object p1, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mContext:Landroid/content/Context;

    .line 58
    new-instance v0, Lcom/htc/android/footprints/utils/StorageUtil$1;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/utils/StorageUtil$1;-><init>(Lcom/htc/android/footprints/utils/StorageUtil;)V

    iput-object v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mReceiver:Landroid/content/BroadcastReceiver;

    .line 85
    return-void
.end method

.method static synthetic access$000(Lcom/htc/android/footprints/utils/StorageUtil;I)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 18
    invoke-direct {p0, p1}, Lcom/htc/android/footprints/utils/StorageUtil;->setState(I)V

    return-void
.end method

.method static synthetic access$102(Z)Z
    .locals 0
    .parameter "x0"

    .prologue
    .line 18
    sput-boolean p0, Lcom/htc/android/footprints/utils/StorageUtil;->mInternalStorageFull:Z

    return p0
.end method

.method public static declared-synchronized availableStorage()J
    .locals 10

    .prologue
    .line 149
    const-class v7, Lcom/htc/android/footprints/utils/StorageUtil;

    monitor-enter v7

    :try_start_0
    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->hasExternalStorage()Z

    move-result v8

    if-nez v8, :cond_0

    .line 150
    const-wide/16 v8, -0x1

    sput-wide v8, Lcom/htc/android/footprints/utils/StorageUtil;->mRemainingStroage:J
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 165
    :goto_0
    :try_start_1
    sget-wide v8, Lcom/htc/android/footprints/utils/StorageUtil;->mRemainingStroage:J
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    monitor-exit v7

    return-wide v8

    .line 152
    :cond_0
    :try_start_2
    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v5

    .line 153
    .local v5, path:Ljava/io/File;
    new-instance v6, Landroid/os/StatFs;

    invoke-virtual {v5}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v8

    invoke-direct {v6, v8}, Landroid/os/StatFs;-><init>(Ljava/lang/String;)V

    .line 154
    .local v6, stat:Landroid/os/StatFs;
    invoke-virtual {v6}, Landroid/os/StatFs;->getBlockSize()I

    move-result v8

    int-to-long v2, v8

    .line 156
    .local v2, blockSize:J
    invoke-virtual {v6}, Landroid/os/StatFs;->getAvailableBlocks()I

    move-result v8

    int-to-long v0, v8

    .line 157
    .local v0, availableBlocks:J
    mul-long v8, v0, v2

    sput-wide v8, Lcom/htc/android/footprints/utils/StorageUtil;->mRemainingStroage:J
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0

    .line 159
    .end local v0           #availableBlocks:J
    .end local v2           #blockSize:J
    .end local v5           #path:Ljava/io/File;
    .end local v6           #stat:Landroid/os/StatFs;
    :catch_0
    move-exception v8

    move-object v4, v8

    .line 163
    .local v4, ex:Ljava/lang/Exception;
    const-wide/16 v8, -0x2

    :try_start_3
    sput-wide v8, Lcom/htc/android/footprints/utils/StorageUtil;->mRemainingStroage:J
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_0

    .line 149
    .end local v4           #ex:Ljava/lang/Exception;
    :catchall_0
    move-exception v8

    monitor-exit v7

    throw v8
.end method

.method public static declared-synchronized checkIternalMemory()J
    .locals 11

    .prologue
    .line 178
    const-class v7, Lcom/htc/android/footprints/utils/StorageUtil;

    monitor-enter v7

    :try_start_0
    new-instance v4, Landroid/os/StatFs;

    sget-object v8, Lcom/htc/android/footprints/utils/StorageUtil;->PATH:Ljava/lang/String;

    invoke-direct {v4, v8}, Landroid/os/StatFs;-><init>(Ljava/lang/String;)V

    .line 179
    .local v4, fileStats:Landroid/os/StatFs;
    invoke-virtual {v4}, Landroid/os/StatFs;->getAvailableBlocks()I

    move-result v8

    int-to-long v0, v8

    .line 180
    .local v0, availableBlocks:J
    invoke-virtual {v4}, Landroid/os/StatFs;->getBlockSize()I

    move-result v8

    int-to-long v2, v8

    .line 181
    .local v2, blockSize:J
    mul-long v5, v0, v2

    .line 182
    .local v5, size:J
    sget-object v8, Lcom/htc/android/footprints/utils/StorageUtil;->TAG:Ljava/lang/String;

    new-instance v9, Ljava/lang/StringBuilder;

    invoke-direct {v9}, Ljava/lang/StringBuilder;-><init>()V

    const-string v10, "internal memory: "

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 183
    monitor-exit v7

    return-wide v5

    .line 178
    .end local v0           #availableBlocks:J
    .end local v2           #blockSize:J
    .end local v4           #fileStats:Landroid/os/StatFs;
    .end local v5           #size:J
    :catchall_0
    move-exception v8

    monitor-exit v7

    throw v8
.end method

.method private static formatSize(J)Ljava/lang/String;
    .locals 6
    .parameter "size"

    .prologue
    const-wide/16 v4, 0x400

    .line 243
    const/4 v2, 0x0

    .line 246
    .local v2, suffix:Ljava/lang/String;
    cmp-long v3, p0, v4

    if-ltz v3, :cond_0

    .line 247
    const-string v2, " KB"

    .line 248
    div-long/2addr p0, v4

    .line 249
    cmp-long v3, p0, v4

    if-ltz v3, :cond_0

    .line 250
    const-string v2, " MB"

    .line 251
    div-long/2addr p0, v4

    .line 255
    :cond_0
    new-instance v0, Ljava/text/DecimalFormat;

    invoke-direct {v0}, Ljava/text/DecimalFormat;-><init>()V

    .line 256
    .local v0, formatter:Ljava/text/DecimalFormat;
    const/4 v3, 0x3

    invoke-virtual {v0, v3}, Ljava/text/DecimalFormat;->setGroupingSize(I)V

    .line 257
    invoke-virtual {v0, p0, p1}, Ljava/text/DecimalFormat;->format(J)Ljava/lang/String;

    move-result-object v1

    .line 259
    .local v1, result:Ljava/lang/String;
    if-eqz v2, :cond_1

    .line 260
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 261
    :cond_1
    return-object v1
.end method

.method private static getFileSize(Ljava/io/File;)J
    .locals 9
    .parameter "file"

    .prologue
    .line 265
    const-wide/16 v5, 0x0

    .line 267
    .local v5, size:J
    if-nez p0, :cond_0

    .line 268
    const-wide/16 v7, 0x0

    .line 276
    :goto_0
    return-wide v7

    .line 269
    :cond_0
    invoke-virtual {p0}, Ljava/io/File;->isFile()Z

    move-result v7

    if-eqz v7, :cond_1

    .line 270
    invoke-virtual {p0}, Ljava/io/File;->length()J

    move-result-wide v7

    goto :goto_0

    .line 272
    :cond_1
    invoke-virtual {p0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v2

    .line 273
    .local v2, files:[Ljava/io/File;
    move-object v0, v2

    .local v0, arr$:[Ljava/io/File;
    array-length v4, v0

    .local v4, len$:I
    const/4 v3, 0x0

    .local v3, i$:I
    :goto_1
    if-ge v3, v4, :cond_2

    aget-object v1, v0, v3

    .line 274
    .local v1, currentFile:Ljava/io/File;
    invoke-static {v1}, Lcom/htc/android/footprints/utils/StorageUtil;->getFileSize(Ljava/io/File;)J

    move-result-wide v7

    add-long/2addr v5, v7

    .line 273
    add-int/lit8 v3, v3, 0x1

    goto :goto_1

    .end local v1           #currentFile:Ljava/io/File;
    :cond_2
    move-wide v7, v5

    .line 276
    goto :goto_0
.end method

.method public static getFootprintStorageDirectory()Ljava/lang/String;
    .locals 2

    .prologue
    .line 122
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v1

    invoke-virtual {v1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    sget-object v1, Ljava/io/File;->separator:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ".footprints"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static declared-synchronized hasExternalStorage()Z
    .locals 3

    .prologue
    .line 132
    const-class v1, Lcom/htc/android/footprints/utils/StorageUtil;

    monitor-enter v1

    :try_start_0
    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    .line 133
    .local v0, state:Ljava/lang/String;
    const-string v2, "mounted"

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v2

    monitor-exit v1

    return v2

    .line 132
    .end local v0           #state:Ljava/lang/String;
    :catchall_0
    move-exception v2

    monitor-exit v1

    throw v2
.end method

.method private initFilter()Landroid/content/IntentFilter;
    .locals 2

    .prologue
    .line 217
    new-instance v0, Landroid/content/IntentFilter;

    const-string v1, "android.intent.action.MEDIA_MOUNTED"

    invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 218
    .local v0, intentFilter:Landroid/content/IntentFilter;
    const-string v1, "android.intent.action.MEDIA_UNMOUNTED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 222
    const-string v1, "android.intent.action.MEDIA_SHARED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 223
    const-string v1, "android.intent.action.DEVICE_STORAGE_LOW"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 224
    const-string v1, "android.intent.action.DEVICE_STORAGE_OK"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 225
    const-string v1, "file"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addDataScheme(Ljava/lang/String;)V

    .line 226
    return-object v0
.end method

.method public static declared-synchronized isExternalStorageEnough()Z
    .locals 5

    .prologue
    .line 170
    const-class v0, Lcom/htc/android/footprints/utils/StorageUtil;

    monitor-enter v0

    :try_start_0
    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->availableStorage()J
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-wide v1

    const-wide/32 v3, 0x200000

    cmp-long v1, v1, v3

    if-lez v1, :cond_0

    const/4 v1, 0x1

    :goto_0
    monitor-exit v0

    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method

.method public static declared-synchronized isExternalStorageEnough(J)Z
    .locals 3
    .parameter "needStorageSize"

    .prologue
    .line 174
    const-class v0, Lcom/htc/android/footprints/utils/StorageUtil;

    monitor-enter v0

    :try_start_0
    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->availableStorage()J
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-wide v1

    cmp-long v1, v1, p0

    if-lez v1, :cond_0

    const/4 v1, 0x1

    :goto_0
    monitor-exit v0

    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method

.method public static declared-synchronized isInternalStorageEnough()Z
    .locals 5

    .prologue
    .line 206
    const-class v2, Lcom/htc/android/footprints/utils/StorageUtil;

    monitor-enter v2

    :try_start_0
    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->checkIternalMemory()J
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-wide v0

    .line 207
    .local v0, size:J
    const-wide/32 v3, 0x500000

    cmp-long v3, v0, v3

    if-gtz v3, :cond_0

    const/4 v3, 0x0

    :goto_0
    monitor-exit v2

    return v3

    :cond_0
    const/4 v3, 0x1

    goto :goto_0

    .line 206
    .end local v0           #size:J
    :catchall_0
    move-exception v3

    monitor-exit v2

    throw v3
.end method

.method public static declared-synchronized isInternalStorageEnough(I)Z
    .locals 5
    .parameter "required"

    .prologue
    .line 211
    const-class v2, Lcom/htc/android/footprints/utils/StorageUtil;

    monitor-enter v2

    :try_start_0
    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->checkIternalMemory()J
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-wide v0

    .line 212
    .local v0, size:J
    int-to-long v3, p0

    cmp-long v3, v0, v3

    if-gtz v3, :cond_0

    const/4 v3, 0x0

    :goto_0
    monitor-exit v2

    return v3

    :cond_0
    const/4 v3, 0x1

    goto :goto_0

    .line 211
    .end local v0           #size:J
    :catchall_0
    move-exception v3

    monitor-exit v2

    throw v3
.end method

.method public static declared-synchronized isInternalStorageEnough(Landroid/content/Context;)Z
    .locals 9
    .parameter "ctx"

    .prologue
    const-wide/32 v7, 0x500000

    const/4 v6, 0x1

    .line 191
    const-class v3, Lcom/htc/android/footprints/utils/StorageUtil;

    monitor-enter v3

    :try_start_0
    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->checkIternalMemory()J
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-wide v1

    .line 193
    .local v1, size:J
    cmp-long v4, v1, v7

    if-lez v4, :cond_0

    move v4, v6

    .line 202
    :goto_0
    monitor-exit v3

    return v4

    .line 197
    :cond_0
    :try_start_1
    invoke-virtual {p0}, Landroid/content/Context;->getCacheDir()Ljava/io/File;

    move-result-object v0

    .line 198
    .local v0, file:Ljava/io/File;
    invoke-static {v0}, Lcom/htc/android/footprints/utils/StorageUtil;->getFileSize(Ljava/io/File;)J
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-wide v4

    add-long/2addr v4, v1

    cmp-long v4, v4, v7

    if-lez v4, :cond_1

    move v4, v6

    .line 199
    goto :goto_0

    .line 202
    :cond_1
    const/4 v4, 0x0

    goto :goto_0

    .line 191
    .end local v0           #file:Ljava/io/File;
    .end local v1           #size:J
    :catchall_0
    move-exception v4

    monitor-exit v3

    throw v4
.end method

.method public static isMediaShared()Z
    .locals 2

    .prologue
    .line 143
    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    .line 144
    .local v0, state:Ljava/lang/String;
    const-string v1, "shared"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    return v1
.end method

.method public static declared-synchronized isStorageEnough(Landroid/content/Context;)Z
    .locals 2
    .parameter "ctx"

    .prologue
    .line 187
    const-class v0, Lcom/htc/android/footprints/utils/StorageUtil;

    monitor-enter v0

    :try_start_0
    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->isInternalStorageEnough()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-static {}, Lcom/htc/android/footprints/utils/StorageUtil;->isExternalStorageEnough()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v1

    if-eqz v1, :cond_0

    const/4 v1, 0x1

    :goto_0
    monitor-exit v0

    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method

.method private setState(I)V
    .locals 1
    .parameter "state"

    .prologue
    .line 238
    iput p1, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mCurrentState:I

    .line 239
    iget-object v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mOnChangeStorageListener:Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;

    invoke-interface {v0, p1}, Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;->onStorageChanged(I)V

    .line 240
    return-void
.end method


# virtual methods
.method public SetOnChangeStorageListerner(Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;)V
    .locals 0
    .parameter "listener"

    .prologue
    .line 230
    iput-object p1, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mOnChangeStorageListener:Lcom/htc/android/footprints/utils/StorageUtil$OnChangeStorageListener;

    .line 231
    return-void
.end method

.method public closeStorgaeUtil()V
    .locals 3

    .prologue
    const/4 v2, 0x1

    .line 100
    iget-object v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mReceiver:Landroid/content/BroadcastReceiver;

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->isReg:Z

    if-ne v0, v2, :cond_0

    .line 101
    iget-object v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {v0, v1}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 102
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->isReg:Z

    .line 103
    sget v0, Lcom/htc/android/footprints/utils/StorageUtil;->StorageCounter:I

    sub-int/2addr v0, v2

    sput v0, Lcom/htc/android/footprints/utils/StorageUtil;->StorageCounter:I

    .line 105
    :cond_0
    return-void
.end method

.method public getExternalStorageDirectory()Ljava/lang/String;
    .locals 1

    .prologue
    .line 113
    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v0

    invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public startStorageUtil()V
    .locals 3

    .prologue
    .line 88
    iget-boolean v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->isReg:Z

    if-nez v0, :cond_0

    .line 89
    iget-object v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/htc/android/footprints/utils/StorageUtil;->mReceiver:Landroid/content/BroadcastReceiver;

    invoke-direct {p0}, Lcom/htc/android/footprints/utils/StorageUtil;->initFilter()Landroid/content/IntentFilter;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 90
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/htc/android/footprints/utils/StorageUtil;->isReg:Z

    .line 91
    sget v0, Lcom/htc/android/footprints/utils/StorageUtil;->StorageCounter:I

    add-int/lit8 v0, v0, 0x1

    sput v0, Lcom/htc/android/footprints/utils/StorageUtil;->StorageCounter:I

    .line 93
    :cond_0
    return-void
.end method
